<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="resources/js/ckeditor.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加用户</title>
</head>
<body>
	<!--没有写action 会提交到/add -->
	<%-- <sf:form method="post" modelAttribute="user" enctype="multipart/form-data"> --%>
	<%-- 	username:<sf:input path="username"/><sf:errors path="username"/><br> --%>
	<%-- 	password:<sf:password path="password"/><sf:errors path="password"/><br> --%>
	<%-- 	email:<sf:input path="email"/><sf:errors path="email"/><br> --%>
	<!-- 	Attachs:<input type="file" name="attachs"/><br> -->
	<!-- 	<input type="file" name="attachs"/><br> -->
	<!-- 	<input type="file" name="attachs"/><br> -->
	<!-- 	<input type="submit" value="添加文章"/> -->
	<%-- </sf:form> --%>
	<div class="container">
		
		<sf:form method="post" modelAttribute="article">
			<sf:errors path="title"/><br>
			<sf:errors path="content"/><br>
			<sf:hidden path="user.id" value="${loginUser.id}" />
			<br />
			<div class="row">
				<div class="col-xs-3">
					<div class="form-group">
						<label for="title">标题</label>
						<sf:input path="title" cssClass="form-control" placeholder="文章标题" />
						
					</div>
				</div>
				<div class="col-xs-3">

					<label for="category">类别</label>
					<div class="checkbox">
						<label><input name="categorys[0].id" type="checkbox"
							value="1" />编程 </label> <label><input name="categorys[1].id"
							type="checkbox" value="2" />数据库 </label> <label><input
							name="categorys[2].id" type="checkbox" value="3" />框架</label> <label><input
							name="categorys[3].id" type="checkbox" value="4" />算法 </label> <label><input
							name="categorys[4].id" type="checkbox" value="5" />设计模式</label>
					</div>
				</div>
				<div class="col-xs-3">

					<label for="category">标签</label>
					<div class="checkbox">
						<label><input name="lables[0].id" type="checkbox"
							value="1" />java </label> <label><input name="lables[1].id"
							type="checkbox" value="8" />spring </label> <label><input
							name="lables[2].id" type="checkbox" value="3" />mybatis</label> <label><input
							name="lables[3].id" type="checkbox" value="5" />mysql</label> <label><input
							name="lables[4].id" type="checkbox" value="11" />spring mvc</label>
							<a class="button">添加新标签</a>
					</div>
				</div>
			</div>
			<br />
			<div class="row">
				<div class="col-xs-10">
					<label for="content">内容(需要插入代码请点击插入代码,按<kbd>
							<kbd>ctrl</kbd>
							+
							<kbd>v</kbd>
						</kbd>)
					</label>
					<sf:textarea path="content" id="editor1" />
				</div>
				<script>
					CKEDITOR.replace('editor1');
				</script>
			</div>
			<br />
			<div class="row">
				<div class="col-xs-2">
					<sf:button class="btn btn-default btn-lg">添加文章</sf:button>
				</div>
				<div class="col-xs-2">
					<sf:button class="btn btn-primary btn-lg"> 保  存 </sf:button>
				</div>
			</div>
		</sf:form>
	</div>
</body>
</html>